package com.slg.android.listenbook.biz.home.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentStatePagerAdapter;

import com.slg.android.listenbook.biz.home.fragment.ChannelFragment;
import com.slg.android.listenbook.biz.home.fragment.PlayerDetailFragment;
import com.viewpagerindicator.IconPagerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * User: Giotto
 * Date: 2015-03-24
 * Time: 15:17
 */
public class FMFragmentAdapter extends FragmentStatePagerAdapter implements IconPagerAdapter {

    public FMFragmentAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        if (position == 0) {
            return new PlayerDetailFragment();
        } else {
            return new ChannelFragment();
        }
    }

    @Override
    public int getIconResId(int index) {
        return 0;
    }

    @Override
    public int getCount() {
        return 2;
    }
}
